{% extends "base_tree.html" %}

{% block list %}
<h3>{{ category.parent.parent.parent.name }}/{{ category.parent.parent.name }}/{{ category.parent.name }}/{{ category.name }}</h3>
<p style="padding-left: 30px;padding-bottom: 8px">
<a href="{% url ktit.storage.views.categorys.edit currentcategory %}">Изменить</a> |
<a href="{% url ktit.storage.views.categorys.delete currentcategory %}">Удалить</a>
</p>


<h4>Существующие открытые документы</h4>

{% if documents %}
  <p>
  {% for doc in documents %}
    <p>
    {% ifequal doc_kind 'R' %}
      <a href="">{{ doc.date }} - {{ doc.name }}</a>
    {% else %}
      {% if serial %} 
        <a href="">{{ doc.date }} - {{ doc.name }}</a>
      {% else %}
        <a href="">{{ doc.date }} - {{ doc.name }}</a>
      {% endif %}
    {% endifequal %}
    </p>
  {% endfor %}
  </p>
{% else %}
  <p>Нет открытых документов</p>
{% endif %}

{% comment %}
<h4>Новый документ</h4>

<form action="." method="POST">
	<table align="left" cellpadding="2" width=100%>
	{% for field in formnewdoc %}<tr>
      <td>{% if field.help_text %}<p>{{ field.help_text }}</p>{% endif %}
	     {% if field.errors %}<p class="myerrors">{{ field.errors }}</p>{% endif %}</td>
      <td rowspan="2">{{ field }}</td>
    </tr>
    <tr>
      <td>{{ field.label_tag }}{% if field.field.required %}<font color="red">*</font>{% endif %}</td>
    </tr>{% endfor %}
	<tr><td></td><td><input type="submit" value="Сохр"></input></td></tr>
	</table>
</form>
{% endcomment %}

<h4>Текущий документ</h4>
<p>
{{ document.name }}
</p>

<h4>Запчасть</h4>

<p>
{{ part.name }}
</p>

<form action="." method="POST">
	<table align="left" cellpadding="2">
	{% for field in form %}<tr>
      <td>{% if field.help_text %}<p>{{ field.help_text }}</p>{% endif %}
	     {% if field.errors %}<p class="myerrors">{{ field.errors }}</p>{% endif %}</td>
      <td rowspan="2">{{ field }}</td>
    </tr>
    <tr>
      <td>{{ field.label_tag }}{% if field.field.required %}<font color="red">*</font>{% endif %}</td>
    </tr>{% endfor %}
	<tr><td></td><td><input type="submit" value="Сохр"></input></td></tr>
	</table>
</form>


{% endblock %}